const user = {
  name: "John",
  age: 10,
  toString() {
    return this.name;
  },
  valueOf() {
    return this;
  },
};

console.log("user:", +user); // NaN
// 相当于
console.log(+"John"); // NaN
